From 3ddbc1385a91870b56fb3d0291a7fb02ed0c2ea4 Mon Sep 17 00:00:00 2001 From: robertlipe Date: Wed, 11 Jun 2014 17:13:46 +0000 Subject: [PATCH] Add freebsd to configure.in. Apparently, they have libusb but no libusb-config. --- gpsbabel/configure | 64 +++++++++++++++++++++++++++++++++++++++++++ gpsbabel/configure.in | 22 +++++++++++++++ 2 files changed, 86 insertions(+) diff --git a/gpsbabel/configure b/gpsbabel/configure index 1ba0a401b..5fb809ff5 100755 --- a/gpsbabel/configure +++ b/gpsbabel/configure @@ -4712,6 +4712,70 @@ rm -f core conftest.err conftest.$ac_objext \ QT_INC_OPT="-F" QT_SYSINC_OPT="-iframework" ;; + *-*-freebsd*) + GBSER=gbser_posix.o + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libusb" >&5 +$as_echo_n "checking for libusb... " >&6; } + if test "$with_libusb" = no ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: check not done" >&5 +$as_echo "check not done" >&6; } + OSJEEPS=jeeps/gpsusbstub.o + else + OLDFLAGS=$LDFLAGS + OCFLAGS=$CFLAGS + LDFLAGS="$LDFLAGS -lusb" + CFLAGS="$OCFLAGS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for usb_interrupt_read in -lusb" >&5 +$as_echo_n "checking for usb_interrupt_read in -lusb... " >&6; } +if ${ac_cv_lib_usb_usb_interrupt_read+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lusb $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char usb_interrupt_read (); +int +main () +{ +return usb_interrupt_read (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_usb_usb_interrupt_read=yes +else + ac_cv_lib_usb_usb_interrupt_read=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_usb_usb_interrupt_read" >&5 +$as_echo "$ac_cv_lib_usb_usb_interrupt_read" >&6; } +if test "x$ac_cv_lib_usb_usb_interrupt_read" = xyes; then : + +$as_echo "#define HAVE_LIBUSB 1" >>confdefs.h + + USB_CFLAGS="" + USB_LIBS="-lusb" +# ,[AC_MSG_ERROR([libusb is needed])] + +fi + + OSJEEPS=jeeps/gpslibusb.o + CFLAGS="$OCFLAGS" + fi + ;; *) GBSER=gbser_posix.o { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libusb" >&5 diff --git a/gpsbabel/configure.in b/gpsbabel/configure.in index 88e797d20..5ad34d1c2 100644 --- a/gpsbabel/configure.in +++ b/gpsbabel/configure.in @@ -229,6 +229,28 @@ case "$target" in QT_INC_OPT="-F" QT_SYSINC_OPT="-iframework" ;; + *-*-freebsd*) + GBSER=gbser_posix.o + AC_MSG_CHECKING(for libusb) + if test "$with_libusb" = no ; then + AC_MSG_RESULT(check not done) + OSJEEPS=jeeps/gpsusbstub.o + else + OLDFLAGS=$LDFLAGS + OCFLAGS=$CFLAGS + LDFLAGS="$LDFLAGS -lusb" + CFLAGS="$OCFLAGS" + + AC_CHECK_LIB([usb], [usb_interrupt_read], + AC_DEFINE(HAVE_LIBUSB, 1, [Defined if you have libusb]) + [USB_CFLAGS=""] + [USB_LIBS="-lusb"] +# ,[AC_MSG_ERROR([libusb is needed])] + ) + OSJEEPS=jeeps/gpslibusb.o + CFLAGS="$OCFLAGS" + fi + ;; *) GBSER=gbser_posix.o AC_MSG_CHECKING(for libusb) -- 2.30.2